package me.dwliu.lab.demo.webflux.dao;

import me.dwliu.lab.demo.webflux.model.Employee;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * 持久层
 * <p>
 * 持久层要被扫描：
 * 1、 注释 @Repository
 * <br/>
 * 2、@Configuration  @EnableReactiveMongoRepositories(basePackages = "me.dwliu.lab.demo.webflux.dao.EmployeeRepository")
 * </p>
 *
 * @author liudw
 * @date 2020-03-29 09:28
 **/
@Repository
public interface EmployeeRepository extends ReactiveMongoRepository<Employee, Long> {
    @Query("{'name':?0}")
    Flux<Employee> findByName(final String name);
}
